document.getElementsByTagName('ul').item(0).addEventListener('click', function (e) {
    console.log(e.target.index());
});